package com.hcss.core.common.logsmgt.controller;



import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hcss.core.common.logsmgt.service.OpertionLogService;
import com.hcss.core.mvc.BaseController;
import com.hcss.core.mvc.page.Pager;



/**  
 * 行为审核日志
 * @ClassName: OpertionLogController
 * @author: lvfang 
 * @date: 2014年4月9日 上午10:36:54
 * @version: V1.0  
 */
@Controller
@RequestMapping("/logs")
public class OpertionLogController extends BaseController {

	@Autowired
	private OpertionLogService opertionLogService;
	
	@RequestMapping("/opertion")
	public String opertion()throws Exception{
		return "/logs/opertionList";
	}
	
	/**
	 *返回所有行为List json数据
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/opertionList", method = RequestMethod.POST)
	@ResponseBody
	public Map<String,Object>getAllOpertion(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		Map<String,Object> parameterMap = request.getParameterMap();
		String userName = request.getParameter("userName");
		String opModel = request.getParameter("opModel");
		String opFunction = request.getParameter("opFunction");
		String opIp = request.getParameter("opIp");
		Pager page = opertionLogService.getAllOpertion(this.getPager(parameterMap), userName, opModel, opFunction, opIp);
		return this.getCurrentPager(page);
	}
}
